package org.lx.nursing.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.lx.common.annotation.Excel;
import org.lx.nursing.domain.CheckInConfig;

import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

@EqualsAndHashCode(callSuper = true)
@Data
@ApiModel("入住信息配置Vo")
public class CheckInConfigVo extends CheckInConfig {
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "入住开始时间", width = 30, dateFormat = "yyyy-MM-dd")
    private LocalDateTime startDate;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "入住结束时间", width = 30, dateFormat = "yyyy-MM-dd")
    private LocalDateTime endDate;

    @Excel(name = "入住床位")
    private String bedNumber;

    @Override
    public String toString() {
        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

        return "CheckInConfigVo(" +
                "id=" + getId() +
                ", checkInId=" + getCheckInId() +
                ", nursingLevelId=" + getNursingLevelId() +
                ", nursingLevelName='" + getNursingLevelName() + '\'' +
                ", feeStartDate=" + (getFeeStartDate() != null ? getFeeStartDate().format(dateTimeFormatter) : null) +
                ", feeEndDate=" + (getFeeEndDate() != null ? getFeeEndDate().format(dateTimeFormatter) : null) +
                ", deposit=" + getDeposit() +
                ", nursingFee=" + getNursingFee() +
                ", bedFee=" + getBedFee() +
                ", insurancePayment=" + getInsurancePayment() +
                ", governmentSubsidy=" + getGovernmentSubsidy() +
                ", otherFees=" + getOtherFees() +
                ", sortOrder=" + getSortOrder() +
                ", createTime=" + (getCreateTime() != null ? simpleDateFormat.format(getCreateTime()) : null) +
                ", updateTime=" + (getUpdateTime() != null ? simpleDateFormat.format(getUpdateTime()) : null) +
                ", startDate=" + (startDate != null ? startDate.format(dateTimeFormatter) : null) +
                ", endDate=" + (endDate != null ? endDate.format(dateTimeFormatter) : null) +
                ", bedNumber='" + bedNumber + '\'' +
                ')';
    }
}
